package com.zego.wawaji.ui.bean.wawa.send;

import com.zego.wawaji.base.data.BaseData;
import com.zego.wawaji.ui.bean.wawa.MyWawa;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by Su on 2018/3/8.
 */

public class MySendList extends BaseData {
    private int length;
    private List<MyWawa> myWawaList = Collections.synchronizedList(new ArrayList<MyWawa>());

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        if (!jsonObject.isNull("Data")) {
            JSONArray jsonArray = getJsonArray(jsonObject.optString("Data"));
            this.myWawaList = (List<MyWawa>) getBaseDataList(jsonArray, MyWawa.class);
        }

        this.length = jsonObject.optInt("Len");
    }

    // =============================== 已申请发货的娃娃 =================================
    public List<MyWawa> getMyWawaSend() {
        return myWawaList;
    }

    public int getLength() {
        return length;
    }
}
